package com.plugin.core.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 设备报警实体类
 * 
 * @author mark
 * @date 2025-07-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("app_device_alarm")
@Schema(name = "AppDeviceAlarm", description = "设备报警表")
public class AppDeviceAlarm {

    @Schema(description = "报警ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "报警设备ID")
    @TableField("device_id")
    private Long deviceId;

    @Schema(description = "用户ID")
    @TableField("app_user_id")
    private Long appUserId;

    @Schema(description = "报警设备编号")
    @TableField("imei")
    private String imei;

    @Schema(description = "设备报警信息")
    @TableField("content")
    private String content;

    @Schema(description = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdTime;

    @Schema(description = "设备名称")
    @TableField("device_name")
    private String deviceName;

    @Schema(description = "消息处理状态(0未处理,1已处理)")
    @TableField("state")
    private Integer state;

    @Schema(description = "解决时间")
    @TableField("solve_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime solveTime;

    @Schema(description = "处理人")
    @TableField("solve_person")
    private String solvePerson;

    @Schema(description = "处理内容")
    @TableField("solve_content")
    private String solveContent;

    @Schema(description = "告警时间")
    @TableField("alarm_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime alarmTime;

    @Schema(description = "是否显示(1,显示-0,不显示)")
    @TableField("show_status")
    private Integer showStatus;
}
